/// select()的参数的FdSet结构
pub type FdSet = libc::fd_set;
/// select()的参数的Timeval结构
pub type Timeval = libc::timeval;

/// 确定一个或多个套接字的状态（如有必要）等待执行同步I/O
#[inline(always)]
pub fn select(nfds: i32, readfds: *mut FdSet, writefds: *mut FdSet, errorfds: *mut FdSet, timeout: *mut Timeval) -> i32
{
    unsafe { libc::select(nfds, readfds, writefds, errorfds, timeout) }
}
/// 将感兴趣的套接字描述符加入集合中
#[inline(always)]
pub fn fd_zero(set: *mut FdSet)
{
    unsafe { libc::FD_ZERO(set) }
}
/// 将感兴趣的套接字描述符加入集合中
#[inline(always)]
pub fn fd_set(fd: Socket, set: *mut FdSet)
{
    unsafe { libc::FD_SET(fd, set) }
}
/// 从集合中移出一个套接口描述符
#[inline(always)]
pub fn fd_clr(fd: Socket, set: *mut FdSet)
{
    unsafe { libc::FD_CLR(fd, set) }
}
/// 检查描述符是否在集合中，如果在集合中返回true，否则返回false
#[inline(always)]
pub fn fd_isset(fd: Socket, set: *const FdSet) -> bool
{
    unsafe { libc::FD_ISSET(fd, set) }
}
